<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="java.util.List,com.dao.Users"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户</title>
</head>
<body>
	<div style="width:600px; position:relative; left:150px;">
	<h1 align="center">用户</h1>
	<c:set var="user" value="${sessionScope.UserMessage}"/>
	<c:forEach items="${list}" var="obj">
	<table width="600" border="1">
		<tr>
			<td>ID:</td>
			<td>${obj.id}</td>
		</tr>
		<tr>
			<td>账号：</td>
			<td>${obj.username}</td>
		</tr>
		<tr>
			<td>昵称：</td>
			<td>${obj.nickname}</td>
		</tr>
		<c:if test="${user.man_id==1}">
		<tr>
			<td><a href="${pageContext.request.contextPath}/users/update.jsp?id=${obj.id}&username=${obj.username}&nickname=${obj.nickname}&password=${obj.password}">修改用户</a></td>
			<td><a href="${pageContext.request.contextPath}/UsersServlet?submittype=delete&id=${obj.id}&username=${obj.username}">删除用户</a></td>
		</tr>
		</c:if>
	</table>
	</c:forEach>
	</div>
	<div style="width:300px; position:absolute; top:100px; left:850px; text-align:center; line-height:30px;">
	<form action="users/control.jsp" method="post">
			<input name="submittype" type="submit" value="返回"/>
  	   </form>
	<form action="${pageContext.request.contextPath}/UsersServlet" method="post">
		<input type="submit" name="submittype" value="退出登录">
	</form>
	<p>${error}</p>
	</div>
</body>
</html>